//{
//     "data": {
//         "show": true,
//         "ios": {
//             "platform": [
//                 "iPhone",
//                 "iPad"
//             ],
//             "minVersionCode": 5,
//             "maxVersionCode": 6,
//             "minVersionName": "1.0.5",
//             "maxVersionName": "1.0.6",
//             "show": false
//         },
//         "android": {
//             "platform": [
//                 "huawei"
//             ],
//             "minVersionCode": 5,
//             "maxVersionCode": 6,
//             "minVersionName": "1.0.5",
//             "maxVersionName": "1.0.6",
//             "show": true
//         }
//     },
//     "resultCode": 0,
//     "resultMsg": "成功！",
//     "queryCount": 0,
//     "resultMsgEx": null
// }
// class ShowOtherLogin {
import 'dart:convert';

class ShowOtherLogin {
  final Data? data;
  final int resultCode;
  final String resultMsg;
  final int? queryCount;
  final dynamic resultMsgEx;

  ShowOtherLogin({
    this.data,
    this.queryCount,
    this.resultMsgEx,
    required this.resultCode,
    required this.resultMsg,
  });

  factory ShowOtherLogin.fromJson(Map<String, dynamic> json) {
    return ShowOtherLogin(
      data: Data.fromJson(json['data']),
      resultCode: json['resultCode'] ?? 0,
      resultMsg: json['resultMsg'] ?? "",
      queryCount: json['queryCount'] ?? 0,
      resultMsgEx: json['resultMsgEx'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'data': data?.toJson(),
      'resultCode': resultCode,
      'resultMsg': resultMsg,
      'queryCount': queryCount,
      'resultMsgEx': resultMsgEx,
    };
  }
}

class Data {
  final bool show;
  final DataPlatform ios;
  final DataPlatform android;

  Data({
    required this.show,
    required this.ios,
    required this.android,
  });

  factory Data.fromJson(Map<String, dynamic> json) {
    return Data(
      show: json['show'] ?? false,
      ios: DataPlatform.fromJson(json['ios']),
      android: DataPlatform.fromJson(json['android']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'show': show,
      'ios': ios.toJson(),
      'android': android.toJson(),
    };
  }
}

class DataPlatform {
  final List<String> platform;
  final int minVersionCode;
  final int maxVersionCode;
  final String minVersionName;
  final String maxVersionName;
  final bool show;

  DataPlatform({
    required this.platform,
    required this.minVersionCode,
    required this.maxVersionCode,
    required this.minVersionName,
    required this.maxVersionName,
    required this.show,
  });

  factory DataPlatform.fromJson(Map<String, dynamic> json) {
    return DataPlatform(
      platform: List<String>.from(json['platform'] ?? []),
      minVersionCode: json['minVersionCode'] ?? 0,
      maxVersionCode: json['maxVersionCode'] ?? 0,
      minVersionName: json['minVersionName'] ?? "",
      maxVersionName: json['maxVersionName'] ?? "",
      show: json['show'] ?? false,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'platform': platform,
      'minVersionCode': minVersionCode,
      'maxVersionCode': maxVersionCode,
      'minVersionName': minVersionName,
      'maxVersionName': maxVersionName,
      'show': show,
    };
  }
}
